﻿@model WebUI.Models.EnumDefine
@using (Ajax.BeginForm(new AjaxOptions()
{
    LoadingElementId = "OnLoadingSpan",
    UpdateTargetId = Request["_utid"],
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "Post",
    OnSuccess = "$('#dialogbox').dialog('close');",
    OnFailure = "OnSiteError"
}))
{
    @Html.ValidationSummary(true)

    @Html.HiddenFor(m => Model.EnumID)
    <table width="100%">
        <tr>
            <td>
                @Html.EditorFor(model => model.EnumName, "TxtField")
            </td>
            <td title="只对SF-36问卷有效，其他请忽略。PF RP BP GH VI SF RE MH HT 之一。">
                @Html.EditorFor(model => model.SF36TYPE, "TxtField")
            </td>
        </tr>
    </table>
    <h3>
        内容:@if (Model != null && Model.QizItems.Count > 0)
           {
            <span>本选择项已经被系统中使用，修改和删除可能会一起系统错误。</span>
           }
    </h3>
    <table width="100%">
        <tr>
            <td>
                取值
            </td>
            <td>
                标题
            </td>
            <td>
                说明
            </td>
            <td>
                分值
            </td>
        </tr>
        @if (null != Model && null != Model.EnumValues)
        {
            foreach (var item in Model.EnumValues)
            {
            <tr>
                <td class="tiny-input">
                    @Html.HiddenFor(model => item.EnumValID)
                    @Html.EditorFor(model => item.OptionValue)
                    @Html.ValidationMessageFor(model => item.OptionValue)
                </td>
                <td class="small-input">
                    @Html.EditorFor(model => item.OptionTitle)
                    @Html.ValidationMessageFor(model => item.OptionTitle)
                </td>
                <td class="big-input">
                    @Html.EditorFor(model => item.OptionDescription)
                    @Html.ValidationMessageFor(model => item.OptionDescription)
                </td>
                <td class="small-input" title="只有SF36问卷有意义">
                    @Html.EditorFor(model => item.SF36Value)
                    @Html.ValidationMessageFor(model => item.SF36Value)
                </td>
            </tr>
            }
        }
        @for (int i = 0; i < 4; i++)
        {
            <tr>
                <td class="tiny-input">
                    @Html.TextBox("NewValueKey")
                </td>
                <td class="small-input">
                    @Html.TextBox("NewValueText")
                </td>
                <td class="big-input">
                    @Html.TextBox("NewDescText")
                </td>
                <td class="small-input" title="只有SF36问卷有意义">
                    @Html.TextBox("NewSF36Value", 0)
                </td>
            </tr>
        }
    </table>
    <p>
        <input type="submit" value="保存" />
    </p>
}
